<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Language" content="en-us" />
  <meta name="description" content="SvgC examples" />
   <link href="prettify.css" media="screen" rel="stylesheet" type="text/css" />
   <link href="style.css" media="screen" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="../js/svg_c.js"></script>
  <script type="text/javascript" src="prettify.js"></script>
  <title>SvgC - Demo2</title>
</head>
<body onload="prettyPrint()">
<div id="container">
  <div id="demo1" type="text/javascript">
    <script type="text/javascript">
    //<![CDATA[
      var c = new SvgC("demo1", 400, 400);
      c.rect(0,0, 400, 400, {fill:"black"});
      c.translate(200, 360);
      c.circle(0, 10, 5, {fill:"#540a0e"});
      for (var i=0; i<80; i++) {
        var w = c.circle(0,0, 5);
        var a = function (w) {
          w.life  = 0;
    	  function ff() {
    	    if (w.life > 0) {
    	      w.posX += w.vecX;
    	      w.posY += w.vecY;
    	      w.vecY += 0.25;
    	    } else {
    	      w.posX = 0;
    	      w.posY = 0;
    	      w.vecX =  Math.random()*4-2;
    	      w.vecY = -Math.random()*2-10;
    	      w.life =  Math.random()*5;
    	    }
    	    w.life -= 0.05;
    	    w.g     = Math.round(255.0/5*w.life);
    	    c.set(w, "cx", w.posX);
    	    c.set(w, "cy", w.posY);
    	    c.set(w, "fill", c.rgb(w.g, 10, 80));
    	  };
    	  setInterval(ff, 100);
        }(w);
      }
     //]]>
    </script>
  </div>
</div>
</body>
</html>
